<?php


namespace App\Services;


use App\Models\HouseList;
use App\Tools\JsonTools;

class HouseTypeInfoServer
{

    /**
     * @Notes:
     * @Author:Planc,
     * @Date: 2022/11/14,
     * @Time: 18:56
     * 房源数据
     */
    public static function houseInfo($offset,$limit,$where,$houseWay){
        $houseList = HouseList::with('houseMolding')->where('house_brokers','!=',' ')
            ->where($where)
            ->where('house_way',$houseWay)
            ->limit($limit)->offset($offset)
            ->get()->toArray();
        $houseListCount = HouseList::with('houseMolding')->where('house_brokers','!=','')
            ->where($where)
            ->where('house_way',$houseWay)
            ->count();

        if(!$houseList){
            return false;
        }else{
            $data=[
                'houseList'=>$houseList,
                'count'=>$houseListCount
            ];
            return $data;
        }


    }
}
